import { cdnRequest } from '@/utils/HttpRequest';

export async function findByRedisList() {
  //SwaggerResources

  return cdnRequest.getList<API.SysConfig>('sys/redis/findByList');
}

export async function redisClear() {
  //SwaggerResources
  let arr: string[] = ['token', 'userInfo', 'umi_locale', 'umi-ui-bubble-hide'];
  let len = localStorage.length;
  for (let i = 0; i < len; i++) {
    let key = localStorage.key(i);
    console.log(key, arr.indexOf(<string>key), arr);
    if (arr.indexOf(<string>key) == -1) {
      if (key != null) {
        localStorage.removeItem(key);
      }
    }
  }

  return cdnRequest.post<any>('sys/redis/delAll', {});
}
